import { getrecentApi } from "../../utils/api";
const recentdata = {
  state() {
    // 获取最近在看的数据
    return {
      recentlist: [],
    };
  },
  mutations: {
    //  改变最近在看的数据
    changerecent(state, payload) {
      state.recentlist = payload;
    },
  },
  actions: {
    async getrecentdata({ commit }) {
      const res = await getrecentApi();
      commit("changerecent", res);
    },
  },
};
export default recentdata;
